package com.atguigu.cloud.apis;

import com.atguigu.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author bairimengchang
 * @version 1.0
 * @project cloud2024
 * @description 账户服务的api接口（供订单模块调用）
 * 下订单->减库存->扣余额->改（订单）状态
 * @date 2024/12/5
 */
@FeignClient(value = "seata-account-service")
public interface AccountFeignApi {

    //扣减账户余额，按标准来说应该使用PutMapping（更新操作）
//    @PostMapping("/account/decrease")
    @PutMapping("/account/decrease")
    ResultData<String> decrease(@RequestParam("userId") Long userId, @RequestParam("money") Long money);

}
